import Home from "@/pages/Home";
import Login from "@/pages/Login";
import Register from "@/pages/Register";
import Search from "@/pages/Search";
import Test from "@/pages/Test";
import Detail from "@/pages/Detail";
import AddCartSuccess from "@/pages/AddCartSuccess";
import ShopCart from "@/pages/ShopCart";
import Trade from "@/pages/Trade";
import Pay from "@/pages/Pay";
import PaySuccess from "@/pages/PaySuccess";

export default [
  {
    path: "/trade",
    component: Trade,
  },
  {
    path: "/pay/:orderId",
    component: Pay,
  },
  {
    path: "/paysuccess",
    component: PaySuccess,
  },
  {
    path: "/shopcart",
    component: ShopCart,
  },
  {
    path: "/addcartsuccess",
    component: AddCartSuccess,
  },
  {
    path: "/home",
    component: Home,
  },
  {
    path: "/login",
    component: Login,
    meta: {
      //元 代表配置路由元数据
      isHidden: "true",
    },
  },
  {
    path: "/register",
    component: Register,
    meta: {
      //元 代表配置路由元数据
      isHidden: "true",
    },
  },
  {
    path: "/search/:keyword?",
    component: Search,
    name: "search",
    props: (route) => ({ ...route.params }),
  },
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/test",
    component: Test,
  },
  {
    path: "/detail/:skuId",
    component: Detail,
  },
];
